import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { BehaviorSubject } from 'rxjs';
import { ApiService } from 'src/app/services/api.service';

@Component({
  selector: 'app-permission-detail',
  templateUrl: './permission-detail.component.html',
  styleUrls: ['./permission-detail.component.less']
})
export class PermissionDetailComponent {
  index: number = 0;
  clientId: BehaviorSubject<string> = new BehaviorSubject('');

  constructor(private _route: ActivatedRoute,
    private _api: ApiService) {
      this._route.queryParams.subscribe((params) => {
        const clientIdParam = params['clientId'];
        const indexParam = params['index'];
        console.log(`detail get clientId ${clientIdParam}, index ${indexParam}`);

        this.index = indexParam;
        this.clientId.next(clientIdParam);
      });
  }
}
